﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;

namespace BL.ServerBL
{
    public class UserState
    {
        public delegate void UserLogin(string user_name, string user_ip, string user_hostname);
        public delegate void UserLogout(string user_hostname);
        public delegate void BudgetReported(string user_name);
        public static event UserLogin OnUserLogin;
        public static event UserLogout OnUserLogout;
        public static event BudgetReported OnBudgetReported;

        public static void RaiseUserLogin(string user_name, string user_ip, string user_hostname)
        {
            if (OnUserLogin != null)
            {
                OnUserLogin.BeginInvoke(user_name, user_ip, user_hostname, null, null);
            }
        }
        public static void RaiseUserLogout(string user_hostname)
        {
            if (OnUserLogout != null)
            {
                OnUserLogout.BeginInvoke(user_hostname, null, null);
            }
        }
        public static void RaiseBudgetReported(string user_name)
        {
            if (OnBudgetReported != null)
            {
                OnBudgetReported.BeginInvoke(user_name, null, null);
            }
        }
        
    }
}
